#include <iostream>
using std::cout;
using std::endl;

class Base{
public:
    Base(long x)
    : _base(x)
    {}

    virtual void display() const{
        cout << "Base::display()" << endl;
    }
private:
    long _base;
};


class Derived
: public Base
{
public:
    Derived(long base,long derived)
    : Base(base)
    , _derived(derived)
    {}

    void display() const{
        cout << "Derived::display()" << endl;
    }

    void show() const{
        cout << "Derived::show()" << endl;
    }
/* private: */
    long _derived;
};

void print(Base * pbase){
    pbase->display();
}

void test0(){
    cout << sizeof(Base) << endl;
    cout << sizeof(Derived) << endl;

    Base base(1);
    Derived d1(10,20);

    Base * p1 = &base;
    p1->display();

    Derived * p2 = &d1;
    p2->display();

    Base * p3 = &d1;
    p3->display();


    /* p3->show(); */
    /* p3->_derived; */

    print(p3);
}

int main(void){
    test0();
    return 0;
}
